package com.taojiazheng.daoImpl.order;

import com.taojiazheng.dao.order.OrderDao;
import com.taojiazheng.entity.Order;
import com.taojiazheng.mapper.OrderMapper;
import com.taojiazheng.vo.Order.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author 赵成林
 * @date 2017/11/25 20:39
 */
@Repository
public class OrderDaoImpl  implements OrderDao{
    @Autowired
    private OrderMapper orderMapper;
    public int createOrder(Order order) {
       // return 0;
        orderMapper.insert(order);
        return order.getId();
    }

    public List<OrderVo> getOrder(Order order) {
        //return null;
        return orderMapper.getOrder(order);
    }

    public int updateOrder(Order order) {
        return orderMapper.updateByPrimaryKeySelective(order);
    }

    public List<Order> getOrderByUserId(Map map) {
        //return null;
        return orderMapper.getOrderByUserId(map);
    }
}
